local var "countryname"
gen id_new=.
replace id_new = 4 if inlist(`var', "AFG", "AF", "Afghanistan")
replace id_new = 8 if inlist(`var', "ALB", "AL", "Albania", "Albanien", "Albania, People's Socialist Republic of")
replace id_new = 10 if inlist(`var', "ATA", "AQ", "Antarctica", "Antarktis", "Antarctica (the territory South of 60 deg S)")
replace id_new = 12 if inlist(`var', "DZA", "DZ", "Algeria", "Algeriet", "Algeria, People's Democratic Republic of")
replace id_new = 16 if inlist(`var', "ASM", "AS", "American Samoa", "Samoa")
replace id_new = 20 if inlist(`var', "AND", "AD", "Andorra", "Andorra, Principality of")
replace id_new = 24 if inlist(`var', "AGO", "AO", "Angola", "Angola, Republic of")
replace id_new = 28 if inlist(`var', "ATG", "AG", "Antigua and Barbuda", "Antigua og Barbuda", "Antigua", "Antigua & Barbuda", "ANTIGUA-BARBUDA")
replace id_new = 31 if inlist(`var', "AZE", "AZ", "Azerbaijan", "Azerbajdjan", "Azerbaijan, Republic of", "USSR-AZE")
replace id_new = 32 if inlist(`var', "ARG", "AR", "Argentina", "Argentina, Argentine Republic")
replace id_new = 36 if inlist(`var', "AUS", "AU", "Australia", "Australien", "Australia, Commonwealth of", "Australia/Australie ")
replace id_new = 40 if inlist(`var', "AUT", "AT", "Austria", "ÿstrig", "Austria, Republic of", "Austria/Autriche")
replace id_new = 44 if inlist(`var', "BHS", "BS", "Bahamas", "Bahama-¯erne", "Bahamas, Commonwealth of the", "Bahamas, The")
replace id_new = 48 if inlist(`var', "BHR", "BH", "Bahrain", "Bahrain, Kingdom of")
replace id_new = 50 if inlist(`var', "BGD", "BD", "Bangladesh", "Bangladesh, People's Republic of")
replace id_new = 51 if inlist(`var', "ARM", "AM", "Armenia", "Armenien", "USSR-ARM")
replace id_new = 52 if inlist(`var', "BRB", "BB", "Barbados")
replace id_new = 56 if inlist(`var', "BEL", "BE", "Belgium", "Belgien", "Belgium, Kingdom of", "Belgium/Belgique")
replace id_new = 60 if inlist(`var', "BMU", "BM", "Bermuda")
replace id_new = 64 if inlist(`var', "BTN", "BT", "Bhutan", "Bhutan, Kingdom of")
replace id_new = 68 if inlist(`var', "BOL", "BO", "Bolivia", "Bolivia, Republic of")
replace id_new = 70 if inlist(`var', "BIH", "BA", "Bosnia and Herzegovina", "Bosnien-Herzegovina", "Bosnia", "Bosnia-Herzegovina", "Bosnia-Herz")
replace id_new = 72 if inlist(`var', "BWA", "BW", "Botswana", "Botswana", "Botswana, Republic of")
replace id_new = 74 if inlist(`var', "BVT", "BV", "Bouvet Island", "Bouvet Island (Bouvetoya)")
replace id_new = 76 if inlist(`var', "BRA", "BR", "Brazil", "Brasilien", "Brazil, Federative Republic of")
replace id_new = 84 if inlist(`var', "BLZ", "BZ", "Belize")
replace id_new = 86 if inlist(`var', "IOT", "IO", "British Indian Ocean Territory", "British Indian Ocean Territory (Chagos Archipelago)", "Chagos Archipelago")
replace id_new = 90 if inlist(`var', "SLB", "SB", "Solomon Islands", "Solomon-¯erne", "Solomon Islands (was British Solomon Islands)", "SOLOMON ISL.", "Solomon Is.")
replace id_new = 92 if inlist(`var', "VGB", "VG", "Virgin Islands, British", "UK Virgin Islands", "British Virgin Islands")
replace id_new = 96 if inlist(`var', "BRN", "BN", "Brunei Darussalam", "Brunei")
replace id_new = 100 if inlist(`var', "BGR", "BG", "Bulgaria", "Bulgarien", "Bulgaria, People's Republic of")
replace id_new = 104 if inlist(`var', "MMR", "MM", "Myanmar", "Burma", "Myanmar (was Burma)", "Myanmar (Burma)")
replace id_new = 108 if inlist(`var', "BDI", "BI", "Burundi", "Burundi, Republic of")
replace id_new = 112 if inlist(`var', "BLR", "BY", "Belarus")
replace id_new = 116 if inlist(`var', "KHM", "KH", "Cambodia", "Cambodja", "Cambodia, Kingdom of (was Khmer Republic/Kampuchea, Democratic)", "Democratic Kampuchea")
replace id_new = 120 if inlist(`var', "CMR", "CM", "Cameroon", "Cameroun", "Cameroon, United Republic of")
replace id_new = 124 if inlist(`var', "CAN", "CA", "Canada")
replace id_new = 132 if inlist(`var', "CPV", "CV", "Cape Verde", "Kapverdiske ÿer", "Cape Verde, Republic of", "C. Verde Is.")
replace id_new = 136 if inlist(`var', "CYM", "KY", "Cayman Islands", "CAYMAN ISL.")
replace id_new = 140 if inlist(`var', "CAF", "CF", "Central African Republic", "Centralafrikanske Republik", "Central Afr. R.", "CENTRAL AFRICAN REP.", "Cent. Af. Rep.", "Central African Rep")
replace id_new = 144 if inlist(`var', "LKA", "LK", "Sri lanka", "Sri Lanka, Democratic Socialist Republic of (was Ceylon)")
replace id_new = 148 if inlist(`var', "TCD", "TD", "Chad", "Tchad", "Chad, Republic of")
replace id_new = 152 if inlist(`var', "CHL", "CL", "Chile", "Chile, Republic of")
replace id_new = 156 if inlist(`var', "CHN", "CN", "China", "Kina", "China, People's Republic of")
replace id_new = 158 if inlist(`var', "TWN", "TW", "Taiwan, Province of China", "Taiwan")
replace id_new = 162 if inlist(`var', "CXR", "CX", "Christmas Island")
replace id_new = 166 if inlist(`var', "CCK", "CC", "Cocos (Keeling) Islands")
replace id_new = 170 if inlist(`var', "COL", "CO", "Colombia", "Colombia, Republic of")
replace id_new = 174 if inlist(`var', "COM", "KM", "Comoros", "Comorerne", "Comoros, Union of the", "Comoro Is.")
replace id_new = 175 if inlist(`var', "MYT", "YT", "Mayotte", "Mayotte")
replace id_new = 178 if inlist(`var', "COG", "CG", "Congo", "Congo, People's Republic of", "Congo, Rep.", "Congo, Republic of", "Congo Brazzaville", "Congo (Brazzaville)")
replace id_new = 180 if inlist(`var', "COD", "CD", "Congo, the Democratic Republic of The", "Congo, Den Demokratiske Republik ")
replace id_new = 180 if inlist(`var', "Congo, Democratic Republic of (was Zaire)", "Congo, Dem. Rep.", "Zaire", "Congo Kinshasa", "Congo (Kinshasa)", "Congo (Democratic Republic of the)", "Zaire (Democ Republic Congo)", "Congo Dem Rep")
replace id_new = 184 if inlist(`var', "COK", "CK", "Cook Islands", "Cook ÿerne")
replace id_new = 188 if inlist(`var', "CRI", "CR", "Costa Rica", "Costa Rica, Republic of")
replace id_new = 191 if inlist(`var', "HRV", "HR", "Croatia", "Kroatien", "Hrvatska (Croatia)", "FYUG-HRV")
replace id_new = 192 if inlist(`var', "CUB", "CU", "Cuba", "Cuba, Republic of")
replace id_new = 196 if inlist(`var', "CYP", "CY", "Cyprus", "Cypern", "Cyprus, Republic of")
replace id_new = 203 if inlist(`var', "CZE", "CZ", "Czech Republic", "Tjekkiske Republik", "Czech Rep.", "Czech Rep./R.tchËq.", "Czech Rep", "CSFR-CZE")
replace id_new = 204 if inlist(`var', "BEN", "BJ", "Benin", "Benin (was Dahomey), People's Republic of")
replace id_new = 208 if inlist(`var', "DNK", "DK", "Denmark", "Danmark", "Denmark, Kingdom of", "Denmark/Danemark")
replace id_new = 212 if inlist(`var', "DMA", "DM", "Dominica", "Dominica, Commonwealth of")
replace id_new = 214 if inlist(`var', "DOM", "DO", "Dominican Republic", "Dominikanske Republik", "Dominican Rep", "Dominican Rep.", "Dom. Rep.")
replace id_new = 218 if inlist(`var', "ECU", "EC", "Ecuador", "Ecuador, Republic of")
replace id_new = 222 if inlist(`var', "SLV", "SV", "El Salvador", "El Salvador, Republic of")
replace id_new = 226 if inlist(`var', "GNQ", "GQ", "Equatorial Guinea", "∆kvatorial Guinea", "Equatorial Guinea, Republic of", "Eq. Guinea")
replace id_new = 231 if inlist(`var', "ETH", "ET", "Ethiopia", "Etiopien")
replace id_new = 232 if inlist(`var', "ERI", "ER", "Eritrea")
replace id_new = 233 if inlist(`var', "EST", "EE", "Estonia", "Estland", "USSR-EST")
replace id_new = 234 if inlist(`var', "FRO", "FO", "Faroe Islands", "FÊr¯erne", "FAOROE ISL.")
replace id_new = 238 if inlist(`var', "FLK", "FK", "Falkland Islands (Malvinas)", "Falklands¯erne", "Falkland Islands")
replace id_new = 239 if inlist(`var', "SGS", "GS", "South Georgia and the South Sandwich Islands")
replace id_new = 242 if inlist(`var', "FJI", "FJ", "Fiji", "Fiji, Republic of the Fiji Islands")
replace id_new = 246 if inlist(`var', "FIN", "FI", "Finland", "Finland/Finlande", "Finland, Republic of")
replace id_new = 248 if inlist(`var', "ALA", "AX", "≈land Islands", "≈lands¯erne")
replace id_new = 250 if inlist(`var', "FRA", "FR", "France", "Frankrig", "France, French Republic")
replace id_new = 254 if inlist(`var', "GUF", "GF", "French Guiana", "Fransk Guyana")
replace id_new = 258 if inlist(`var', "PYF", "PF", "French Polynesia", "Fransk Polynesien")
replace id_new = 260 if inlist(`var', "ATF", "TF", "French Southern Territories")
replace id_new = 262 if inlist(`var', "DJI", "DJ", "Djibouti", "Djibouti, Republic of (was French Afars and Issas)")
replace id_new = 266 if inlist(`var', "GAB", "GA", "Gabon", "Gabon, Gabonese Republic")
replace id_new = 268 if inlist(`var', "GEO", "GE", "Georgia", "Georgien")
replace id_new = 270 if inlist(`var', "GMB", "GM", "Gambia", "Gambia, The", "Gambia, Republic of the")
replace id_new = 275 if inlist(`var', "PSE", "PS", "Palestinian Territory, Occupied", "PalÊstina", "West Bank and Gaza", "Palestinian Authority Administered Territories (Israel)", "WEST BANK GAZA", "WEST BANK AND GAZA")
replace id_new = 276 if inlist(`var', "DEU", "DE", "Germany", "Tyskland", "Germany/Allemagne")
replace id_new = 278 if inlist(`var', "Germany East", "ÿsttyskland", "Germany, E. ", "GERMANY, EAST")
replace id_new = 280 if inlist(`var', "Germany West", "Vesttyskland", "West Germany", "Germany, W. ", "Germany, West")
replace id_new = 288 if inlist(`var', "GHA", "GH", "Ghana", "Ghana, Republic of")
replace id_new = 292 if inlist(`var', "GIB", "GI", "Gibraltar")
replace id_new = 296 if inlist(`var', "KIR", "KI", "Kiribati", "Gilbert Islands", "Kiribati, Republic of (was Gilbert Islands)")
replace id_new = 300 if inlist(`var', "GRC", "GR", "Greece", "GrÊkenland", "Greece, Hellenic Republic", "Greece/GrËce")
replace id_new = 304 if inlist(`var', "GRL", "GL", "Greenland", "Gr¯nland")
replace id_new = 308 if inlist(`var', "GRD", "GD", "Grenada")
replace id_new = 312 if inlist(`var', "GLP", "GP", "Guadeloupe")
replace id_new = 316 if inlist(`var', "GUM", "GU", "Guam")
replace id_new = 320 if inlist(`var', "GTM", "GT", "Guatemala", "Guatemala, Republic of")
replace id_new = 324 if inlist(`var', "GIN", "GN", "Guinea", "Guinea, Revolutionary People's Rep'c of")
replace id_new = 328 if inlist(`var', "GUY", "GY", "Guyana", "Guyana, Republic of")
replace id_new = 332 if inlist(`var', "HTI", "HT", "Haiti", "Haiti, Republic of")
replace id_new = 334 if inlist(`var', "HMD", "HM", "Heard Island and McDonald Islands", "Heard and McDonald Islands")
replace id_new = 336 if inlist(`var', "VAT", "VA", "Holy See (Vatican City State)", "Vatikanstaten")
replace id_new = 340 if inlist(`var', "HND", "HN", "Honduras", "Honduras, Republic of")
replace id_new = 344 if inlist(`var', "HKG", "HK", "Hong kong", "Hong Kong, Special Administrative Region of China", "Hong Kong, China", "Hong Kong (China)", "Hong Kong, China (SAR)")
replace id_new = 348 if inlist(`var', "HUN", "HU", "Hungary", "Ungarn", "Hungary, Hungarian People's Republic", "Hungary/Hongrie")
replace id_new = 352 if inlist(`var', "ISL", "IS", "Iceland", "Island", "Iceland, Republic of", "Iceland/Islande")
replace id_new = 356 if inlist(`var', "IND", "IN", "India", "Indien", "India, Republic of")
replace id_new = 360 if inlist(`var', "IDN", "ID", "Indonesia", "Indonesien", "Indonesia, Republic of")
replace id_new = 364 if inlist(`var', "IRN", "IR", "Iran, Islamic Republic of", "Iran", "Iran, Islamic Rep.", "Iran, I.R. of")
replace id_new = 368 if inlist(`var', "IRQ", "IQ", "Iraq", "Irak", "Iraq, Republic of")
replace id_new = 372 if inlist(`var', "IRL", "IE", "Ireland", "Irland", "Ireland/Irlande")
replace id_new = 376 if inlist(`var', "ISR", "IL", "Israel", "Israel, State of")
replace id_new = 380 if inlist(`var', "ITA", "IT", "Italy", "Italien", "Italy, Italian Republic", "Italy/Italie")
replace id_new = 384 if inlist(`var', "CIV", "CI", "CÙte d'Ivoire", "Elfenbenskysten", "Cote D'Ivoire, Ivory Coast, Republic of the", "Cote d`Ivoire", "Ivory Coast", "Cote díIvoire")
replace id_new = 388 if inlist(`var', "JAM", "JM", "Jamaica")
replace id_new = 392 if inlist(`var', "JPN", "JP", "Japan", "Japan/Japon")
replace id_new = 398 if inlist(`var', "KAZ", "KZ", "Kazakhstan", "Kazakstan", "Kazakhstan, Republic of")
replace id_new = 400 if inlist(`var', "JOR", "JO", "Jordan", "Jordan, Hashemite Kingdom of")
replace id_new = 404 if inlist(`var', "KEN", "KE", "Kenya", "Kenya, Republic of")
replace id_new = 408 if inlist(`var', "PRK", "KP", "Korea, Democratic People's Republic of", "Nordkorea", "Korea, Dem. Rep.", "Korea, North", "Korea North", "North Korea")
replace id_new = 410 if inlist(`var', "KOR", "KR", "Korea, Republic of", "Sydkorea", "Korea, Rep.", "Korea, South", "Korea South", "South Korea")
replace id_new = 410 if inlist(`var', "Republic of Korea", "Korea/CorÈe")
replace id_new = 414 if inlist(`var', "KWT", "KW", "Kuwait", "Kuwait, State of")
replace id_new = 417 if inlist(`var', "KGZ", "KG", "Kyrgyzstan", "Kirgizistan", "Kyrgyz Republic")
replace id_new = 418 if inlist(`var', "LAO", "LA", "Lao People's Democratic Republic", "Laos", "Lao PDR")
replace id_new = 422 if inlist(`var', "LBN", "LB", "Lebanon", "Libanon", "Lebanon, Lebanese Republic")
replace id_new = 426 if inlist(`var', "LSO", "LS", "Lesotho", "Lesotho, Kingdom of")
replace id_new = 428 if inlist(`var', "LVA", "LV", "Latvia", "Letland", "USSR-LVA")
replace id_new = 430 if inlist(`var', "LBR", "LR", "Liberia", "Liberia, Republic of")
replace id_new = 434 if inlist(`var', "LBY", "LY", "Libyan Arab Jamahiriya", "Libyen", "Libyan Arab Jamahiriya", "Libya")
replace id_new = 438 if inlist(`var', "LIE", "LI", "Liechtenstein", "Liechtenstein, Principality of")
replace id_new = 440 if inlist(`var', "LTU", "LT", "Lithuania", "Litauen", "USSR-LTU")
replace id_new = 442 if inlist(`var', "LUX", "LU", "Luxembourg", "Luxembourg (Grand-DuchÈ)", "Luxembourg, Grand Duchy of")
replace id_new = 446 if inlist(`var', "MAC", "MO", "Macao", "Macao, China", "Macao, Special Administrative Region of China")
replace id_new = 450 if inlist(`var', "MDG", "MG", "Madagascar", "Madagascar, Republic of")
replace id_new = 454 if inlist(`var', "MWI", "MW", "Malawi", "Malawi, Republic of")
replace id_new = 458 if inlist(`var', "MYS", "MY", "Malaysia")
replace id_new = 462 if inlist(`var', "MDV", "MV", "Maldives", "Maldiverne", "Maldives, Republic of")
replace id_new = 466 if inlist(`var', "MLI", "ML", "Mali", "Mali, Republic of")
replace id_new = 470 if inlist(`var', "MLT", "MT", "Malta", "Malta, Republic of")
replace id_new = 474 if inlist(`var', "MTQ", "MQ", "Martinique")
replace id_new = 478 if inlist(`var', "MRT", "MR", "Mauritania", "Mauretanien", "Mauritania, Islamic Republic of")
replace id_new = 480 if inlist(`var', "MUS", "MU", "Mauritius")
replace id_new = 484 if inlist(`var', "MEX", "MX", "Mexico", "Mexico/Mexique", "Mexico, United Mexican States")
replace id_new = 492 if inlist(`var', "MCO", "MC", "Monaco", "Monaco, Principality of")
replace id_new = 496 if inlist(`var', "MNG", "MN", "Mongolia", "Mongoliet", "Mongolia, Mongolian People's Republic")
replace id_new = 498 if inlist(`var', "MDA", "MD", "Moldova, Republic of", "Moldova", "Moldova, Republic of", "Republic of Moldova")
replace id_new = 499 if inlist(`var', "MNE", "ME", "Montenegro")
replace id_new = 500 if inlist(`var', "MSR", "MS", "Montserrat")
replace id_new = 504 if inlist(`var', "MAR", "MA", "Morocco", "Marokko", "Morocco, Kingdom of")
replace id_new = 508 if inlist(`var', "MOZ", "MZ", "Mozambique", "Mozambique, People's Republic of")
replace id_new = 512 if inlist(`var', "OMN", "OM", "Oman", "Oman, Sultanate of (was Muscat and Oman)")
replace id_new = 516 if inlist(`var', "NAM", "NA", "Namibia")
replace id_new = 520 if inlist(`var', "NRU", "NR", "Nauru", "Nauru, Republic of")
replace id_new = 524 if inlist(`var', "NPL", "NP", "Nepal", "Republic of Nepal", "Nepal, Kingdom of")
replace id_new = 528 if inlist(`var', "NLD", "NL", "Netherlands", "Nederlandene", "Netherlands, Kingdom of the", "Netherl./Pays-Bas")
replace id_new = 530 if inlist(`var', "ANT", "AN", "Netherlands Antilles", "Nederlandske Antiller", "Netherlands Antilles")
replace id_new = 533 if inlist(`var', "ABW", "AW", "Aruba")
replace id_new = 540 if inlist(`var', "NCL", "NC", "New Caledonia", "Ny Caledonien")
replace id_new = 548 if inlist(`var', "VUT", "VU", "Vanuatu", "Vanuatu (was New Hebrides)")
replace id_new = 554 if inlist(`var', "NZL", "NZ", "New Zealand", "N. Zealand/N. ZÈl.")
replace id_new = 558 if inlist(`var', "NIC", "NI", "Nicaragua", "Nicaragua, Republic of")
replace id_new = 562 if inlist(`var', "NER", "NE", "Niger", "Niger, Republic of the")
replace id_new = 566 if inlist(`var', "NGA", "NG", "Nigeria", "Nigeria, Federal Republic of")
replace id_new = 570 if inlist(`var', "NIU", "NU", "Niue", "Niue, Republic of")
replace id_new = 574 if inlist(`var', "NFK", "NF", "Norfolk island", "Norfolk ÿerne")
replace id_new = 578 if inlist(`var', "NOR", "NO", "Norway", "Norge", "Norway, Kingdom of", "Norway/NorvËge")
replace id_new = 580 if inlist(`var', "MNP", "MP", "Northern Mariana Islands", "Nordmarianerne", "NORTHERN MARIANA ISL.")
replace id_new = 581 if inlist(`var', "UMI", "UM", "United States Minor Outlying Islands")
replace id_new = 583 if inlist(`var', "FSM", "FM", "Micronesia, Federated States of", "Mikronesien", "Micronesia, Fed. Sts.", "Micronesia")
replace id_new = 584 if inlist(`var', "MHL", "MH", "Marshall islands", "Marshall-¯erne", "MARSHALL ISL.")
replace id_new = 585 if inlist(`var', "PLW", "PW", "Palau")
replace id_new = 586 if inlist(`var', "PAK", "PK", "Pakistan", "Pakistan, Islamic Republic of")
replace id_new = 591 if inlist(`var', "PAN", "PA", "Panama", "Panama, Republic of")
replace id_new = 598 if inlist(`var', "PNG", "PG", "Papua New Guinea", "Papua New Guin.", "P. N. Guinea")
replace id_new = 600 if inlist(`var', "PRY", "PY", "Paraguay", "Paraguay, Republic of")
replace id_new = 604 if inlist(`var', "PER", "PE", "Peru", "Peru, Republic of")
replace id_new = 608 if inlist(`var', "PHL", "PH", "Philippines", "Filippinerne", "Philippines, Republic of the")
replace id_new = 612 if inlist(`var', "PCN", "PN", "Pitcairn", "Pitcairn¯erne", "Pitcairn Island")
replace id_new = 616 if inlist(`var', "POL", "PL", "Poland", "Polen", "Poland, Polish People's Republic", "Poland/Pologne")
replace id_new = 620 if inlist(`var', "PRT", "PT", "Portugal", "Portugal, Portuguese Republic")
replace id_new = 624 if inlist(`var', "GNB", "GW", "Guinea-Bissau", "Guinea-Bissau, Republic of (was Portuguese Guinea)")
replace id_new = 626 if inlist(`var', "TLS", "TL", "Timor-Leste", "ÿsttimor", "Timor-Leste, Democratic Republic of", "East Timor")
replace id_new = 630 if inlist(`var', "PRI", "PR", "Puerto Rico", "Puerto Rico (United States)")
replace id_new = 634 if inlist(`var', "QAT", "QA", "Qatar", "Qatar, State of")
replace id_new = 638 if inlist(`var', "REU", "RE", "RÈunion", "Reunion")
replace id_new = 642 if inlist(`var', "ROU", "RO", "Romania", "RumÊnien", "Romania, Socialist Republic of")
replace id_new = 643 if inlist(`var', "RUS", "RU", "Russian Federation", "Rusland", "Russia", "RUSSIA (SOVIET UNION)")
replace id_new = 646 if inlist(`var', "RWA", "RW", "Rwanda", "Rwanda, Rwandese Republic")
replace id_new = 652 if inlist(`var', "BLM", "BL", "Saint BarthÈlemy")
replace id_new = 654 if inlist(`var', "SHN", "SH", "Saint Helena", "St. Helena")
replace id_new = 659 if inlist(`var', "KNA", "KN", "Saint Kitts and Nevis", "St. Kitts og Nevis", "St. Kitts and Nevis", "St. Kitts & Nevis", "Saint Kitts & Nevis", "ST KITTS-NEVIS")
replace id_new = 660 if inlist(`var', "AIA", "AI", "Anguilla")
replace id_new = 662 if inlist(`var', "LCA", "LC", "Saint Lucia", "St. Lucia", "ST LUCIA")
replace id_new = 663 if inlist(`var', "MAF", "MF", "Saint Martin")
replace id_new = 666 if inlist(`var', "SPM", "PM", "Saint Pierre and Miquelon", "Saint Pierre og Miquelon", "St. Pierre and Miquelon")
replace id_new = 670 if inlist(`var', "VCT", "VC", "Saint Vincent and the Grenadines", "St. Vincent og Grenadinerne", "St. Vincent and the Grenadines", "St.Vincent & Grenadines", "Saint Vincent & the Grenadines", "St.Vincent & G.", "ST VINCENT-GRENADINES")
replace id_new = 674 if inlist(`var', "SMR", "SM", "San Marino", "San Marino, Republic of")
replace id_new = 678 if inlist(`var', "STP", "ST", "Sao Tome and Principe", "Sao TomÈ og Principe", "Sao Tome and Principe, Democratic Republic of", "Sao Tome & Principe", "SAO TOME-PRINCIPE")
replace id_new = 682 if inlist(`var', "SAU", "SA", "Saudi Arabia", "Saudi Arabien", "Saudi Arabia, Kingdom of")
replace id_new = 686 if inlist(`var', "SEN", "SN", "Senegal", "Senegal, Republic of")
replace id_new = 688 if inlist(`var', "SRB", "RS", "Serbia", "Serbien")
replace id_new = 690 if inlist(`var', "SYC", "SC", "Seychelles", "Seychellerne", "Seychelles, Republic of")
replace id_new = 694 if inlist(`var', "SLE", "SL", "Sierra Leone", "Sierra Leone, Republic of")
replace id_new = 702 if inlist(`var', "SGP", "SG", "Singapore", "Singapore, Republic of")
replace id_new = 703 if inlist(`var', "SVK", "SK", "Slovakia", "Slovakiske Republik", "Slovakia (Slovak Republic)", "Slovak Republic", "Slovak Rep./R. slov.", "CSFR-SVK")
replace id_new = 704 if inlist(`var', "VNM", "VN", "Viet Nam", "Vietnam", "Viet Nam, Socialist Republic of (was Democratic Republic of & Republic of)")
replace id_new = 705 if inlist(`var', "SVN", "SI", "Slovenia", "Slovenien", "FYUG-SVN")
replace id_new = 706 if inlist(`var', "SOM", "SO", "Somalia", "Somalia, Somali Republic")
replace id_new = 710 if inlist(`var', "ZAF", "ZA", "South Africa", "Sydafrika", "South Africa, Republic of", "S. Africa")
replace id_new = 716 if inlist(`var', "ZWE", "ZW", "Zimbabwe", "Zimbabwe (was Southern Rhodesia)")
replace id_new = 724 if inlist(`var', "ESP", "ES", "Spain", "Spanien", "Spain, Spanish State", "Spain/Espagne")
replace id_new = 732 if inlist(`var', "ESH", "EH", "Western Sahara", "Vestsahara", "Western Sahara (was Spanish Sahara)", "Western Sahara (Morocco)")
replace id_new = 736 if inlist(`var', "SDN", "SD", "Sudan", "Sudan, Democratic Republic of the")
replace id_new = 740 if inlist(`var', "SUR", "SR", "Suriname", "Surinam", "Suriname, Republic of")
replace id_new = 744 if inlist(`var', "SJM", "SJ", "Svalbard and Jan Mayen", "Svalbard", "Svalbard & Jan Mayen Islands")
replace id_new = 748 if inlist(`var', "SWZ", "SZ", "Swaziland", "Swaziland, Kingdom of")
replace id_new = 752 if inlist(`var', "SWE", "SE", "Sweden", "Sverige", "Sweden, Kingdom of", "Sweden/SuËde")
replace id_new = 756 if inlist(`var', "CHE", "CH", "Switzerland", "Schweiz", "Switzerland, Swiss Confederation", "Switzerland/Suisse")
replace id_new = 760 if inlist(`var', "SYR", "SY", "Syrian Arab Republic", "Syrien", "Syria")
replace id_new = 762 if inlist(`var', "TJK", "TJ", "Tajikistan", "Tadjikistan")
replace id_new = 764 if inlist(`var', "THA", "TH", "Thailand", "Thailand, Kingdom of")
replace id_new = 768 if inlist(`var', "TGO", "TG", "Togo", "Togo, Togolese Republic")
replace id_new = 772 if inlist(`var', "TKL", "TK", "Tokelau", "Tokelau (Tokelau Islands)")
replace id_new = 776 if inlist(`var', "TON", "TO", "Tonga", "Tonga, Kingdom of")
replace id_new = 780 if inlist(`var', "TTO", "TT", "Trinidad and Tobago", "Trinidad og Tobago", "Trinidad and Tobago, Republic of", "Trinidad & Tobago", "Trinidad", "Trinidad & Tob.", "Trinidad-Tobago")
replace id_new = 784 if inlist(`var', "ARE", "AE", "United Arab Emirates", "Forenede Arabiske Emirater", "United Arab Emirates (was Trucial States)", "United Arab Em.")
replace id_new = 788 if inlist(`var', "TUN", "TN", "Tunisia", "Tunesien", "Tunisia, Republic of")
replace id_new = 792 if inlist(`var', "TUR", "TR", "Turkey", "Tyrkiet", "Turkey, Republic of", "Turkey/Turquie")
replace id_new = 795 if inlist(`var', "TKM", "TM", "Turkmenistan", "Turkmenistan")
replace id_new = 796 if inlist(`var', "TCA", "TC", "Turks and Caicos Islands", "Turks/Caicos Islands")
replace id_new = 798 if inlist(`var', "TUV", "TV", "Tuvalu", "Tuvalu (was part of Gilbert & Ellice Islands)")
replace id_new = 800 if inlist(`var', "UGA", "UG", "Uganda", "Uganda, Republic of")
replace id_new = 804 if inlist(`var', "UKR", "UA", "Ukraine")
replace id_new = 807 if inlist(`var', "MKD", "MK", "Macedonia, The Former Yugoslav Republic of", "Makedonien", "Macedonia, FYR", "Macedonia", "Macedonia (Former Yug. Rep)", "Macedonia (TFYR)")
replace id_new = 818 if inlist(`var', "EGY", "EG", "Egypt", "Egypten", "Egypt, Arab Republic of", "Egypt, Arab Rep.")
replace id_new = 826 if inlist(`var', "GBR", "GB", "United Kingdom", "Storbritannien og Nordirland", "United Kingdom of Great Britain & N. Ireland", "UK", "UK/Royaume-Uni")
replace id_new = 830 if inlist(`var', "Channel Islands", "Kanal¯erne", "CHANNEL ISL.")
replace id_new = 831 if inlist(`var', "GGY", "GG", "Guernsey")
replace id_new = 832 if inlist(`var', "JEY", "JE", "Jersey")
replace id_new = 833 if inlist(`var', "IMN", "IM", "Isle of Man")
replace id_new = 834 if inlist(`var', "TZA", "TZ", "Tanzania, United Republic of", "Tanzania")
replace id_new = 840 if inlist(`var', "USA", "US", "United States", "USA", "United States of America", "USA/Etats-Unis")
replace id_new = 850 if inlist(`var', "VIR", "VI", "Virgin Islands, U.S.", "US Virgin Islands", "Virgin Islands (U.S.)", "VIRGIN ISL.")
replace id_new = 854 if inlist(`var', "BFA", "BF", "Burkina Faso", "Upper Volta", "Burkina Faso (was Upper Volta)")
replace id_new = 858 if inlist(`var', "URY", "UY", "Uruguay", "Uruguay, Eastern Republic of")
replace id_new = 860 if inlist(`var', "UZB", "UZ", "Uzbekistan")
replace id_new = 862 if inlist(`var', "VEN", "VE", "Venezuela", "Venezuela, Bolivarian Republic of", "Venezuela, RB")
replace id_new = 876 if inlist(`var', "WLF", "WF", "Wallis and Futuna", "Wallis og Futuna¯erne", "Wallis and Futuna Islands")
replace id_new = 882 if inlist(`var', "WSM", "WS", "Samoa", "Western Samoa", "Samoa, Independent State of (was Western Samoa)", "W. Samoa")
replace id_new = 887 if inlist(`var', "YEM", "YE", "Yemen", "Yemen, Rep.")
replace id_new = 890 if inlist(`var', "Socialist Federal Republic of Yugoslavia", "Jugoslavien", "YUGOSLAVIA")
replace id_new = 891 if inlist(`var', "SCG", "CS", "Serbia and Montenegro", "Serbien og Montenegro", "Serbia & Montenegro", "FYUG-YUG")
replace id_new = 894 if inlist(`var', "ZMB", "ZM", "Zambia", "Zambia, Republic of")

replace id_new = 826 if inlist(`var', "GBR", "GB", "United Kingdom", "Storbritannien og Nordirland", "United Kingdom of Great Britain & N. Ireland", "UK", "UK/Royaume-Uni", "Great Britain")

